home *** CD-ROM | disk | FTP | other *** search
/ Windows Game Programming for Dummies (2nd Edition) / WinGamProgFD.iso / mac / DirectX SDK / DXSDK / samples / Multimedia / VBSamples / DirectPlay / Conferencer / frmJoinRequest.frm < prev    next >
Text File  |  2001-10-08  |  4KB  |  113 lines

  1. VERSION 5.00
  2. Begin VB.Form frmJoinRequest 
  3.    BorderStyle     =   3  'Fixed Dialog
  4.    Caption         =   "Receiving a call...."
  5.    ClientHeight    =   975
  6.    ClientLeft      =   45
  7.    ClientTop       =   330
  8.    ClientWidth     =   4680
  9.    ControlBox      =   0   'False
  10.    LinkTopic       =   "Form1"
  11.    MaxButton       =   0   'False
  12.    MinButton       =   0   'False
  13.    ScaleHeight     =   975
  14.    ScaleWidth      =   4680
  15.    ShowInTaskbar   =   0   'False
  16.    StartUpPosition =   3  'Windows Default
  17.    Begin VB.CommandButton cmdReject 
  18.       Cancel          =   -1  'True
  19.       Caption         =   "Reject"
  20.       Height          =   315
  21.       Left            =   3420
  22.       TabIndex        =   3
  23.       Top             =   120
  24.       Width           =   1155
  25.    End
  26.    Begin VB.CommandButton cmdAccept 
  27.       Caption         =   "Accept"
  28.       Default         =   -1  'True
  29.       Height          =   315
  30.       Left            =   3420
  31.       TabIndex        =   2
  32.       Top             =   540
  33.       Width           =   1155
  34.    End
  35.    Begin VB.Label lblFriend 
  36.       BackStyle       =   0  'Transparent
  37.       Height          =   195
  38.       Left            =   720
  39.       TabIndex        =   1
  40.       Top             =   420
  41.       Width           =   2115
  42.    End
  43.    Begin VB.Label Label1 
  44.       BackStyle       =   0  'Transparent
  45.       Caption         =   "You are receiving a call from"
  46.       Height          =   195
  47.       Left            =   720
  48.       TabIndex        =   0
  49.       Top             =   180
  50.       Width           =   2115
  51.    End
  52.    Begin VB.Image Image1 
  53.       Height          =   480
  54.       Left            =   120
  55.       Picture         =   "frmJoinRequest.frx":0000
  56.       Top             =   180
  57.       Width           =   480
  58.    End
  59. End
  60. Attribute VB_Name = "frmJoinRequest"
  61. Attribute VB_GlobalNameSpace = False
  62. Attribute VB_Creatable = False
  63. Attribute VB_PredeclaredId = True
  64. Attribute VB_Exposed = False
  65. Option Explicit
  66. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  67. '
  68. '  Copyright (C) 1999-2001 Microsoft Corporation.  All Rights Reserved.
  69. '
  70. '  File:       frmJoinRequest.frm
  71. '
  72. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  73. Private mlPlayerID As Long
  74. Private msPlayername As String
  75. Private moForm As frmNetwork
  76.  
  77. Public Sub SetupRequest(oForm As frmNetwork, ByVal lPlayerID As Long, ByVal sPlayerName As String)
  78.     Set moForm = oForm
  79.     mlPlayerID = lPlayerID
  80.     msPlayername = sPlayerName
  81.     lblFriend.Caption = sPlayerName
  82. End Sub
  83.  
  84. Private Sub cmdAccept_Click()
  85.     Dim lMsg As Long, lOffset As Long
  86.     Dim oBuf() As Byte
  87.     
  88.     'Accept this connection
  89.     lMsg = MsgAcceptJoin
  90.     lOffset = NewBuffer(oBuf)
  91.     AddDataToBuffer oBuf, lMsg, LenB(lMsg), lOffset
  92.     dpp.SendTo mlPlayerID, oBuf, 0, DPNSEND_NOLOOPBACK
  93.     moForm.UpdatePlayerList
  94.     'Notify everyone that this player has joined
  95.     lMsg = MsgNewPlayerJoined
  96.     lOffset = NewBuffer(oBuf)
  97.     AddDataToBuffer oBuf, lMsg, LenB(lMsg), lOffset
  98.     dpp.SendTo DPNID_ALL_PLAYERS_GROUP, oBuf, 0, DPNSEND_NOLOOPBACK Or DPNSEND_GUARANTEED
  99.     Unload Me
  100. End Sub
  101.  
  102. Private Sub cmdReject_Click()
  103.     Dim lMsg As Long, lOffset As Long
  104.     Dim oBuf() As Byte
  105.     
  106.     'Reject this connection
  107.     lMsg = MsgRejectJoin
  108.     lOffset = NewBuffer(oBuf)
  109.     AddDataToBuffer oBuf, lMsg, LenB(lMsg), lOffset
  110.     dpp.SendTo mlPlayerID, oBuf, 0, DPNSEND_NOLOOPBACK
  111.     Unload Me
  112. End Sub
  113.